package org.zsl.controller;

import com.alibaba.fastjson.JSON;
import org.zsl.model.User;
import org.zsl.service.UserService2;

import javax.servlet.*;
import javax.servlet.http.*;
import java.io.IOException;
import java.util.List;

public class UserListController extends HttpServlet {

    private UserService2 service2= new UserService2();
    @Override
    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

      List<User> userList=   service2.getList();

      response.getWriter().write(JSON.toJSONString(userList));


    }

    @Override
    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    }
}
